﻿#通用基类

project(libbase)


option(HTTP_ENABLED "Enable http" ON) #http 协议使能

option(DB_ENABLED "Enable Data Base" ON)	#数据使能
option(SQL_ENABLED "Enable sql" ON)			# 数据库类型sql使能

option(TCP_ENABLED "Enable tcp" ON)	 #TCP协议使能



include(http/http.cmake)
include(database/database.cmake)
include(tcp/tcp.cmake)

find_package(Qt5Core REQUIRED) #REQUIRED 表示库是必须的，找不到会报错
#find_package(Qt5Network REQUIRED) # Qt 组件（网络模块）

include_directories(${QTDIR}/include/core)

#message(STATUS "HTTP_SRC = ${LOGGER_SRC}")
message(STATUS "HTTP_LIB = ${TCP_SRC}")

add_library(${PROJECT_NAME} SHARED
			${HTTP_SRC}
			${DB_SRC}
			${TCP_SRC}
			  "dll_export.h")

target_link_libraries( ${PROJECT_NAME} PRIVATE Qt5::Core  ${HTTP_LIB}
						${DB_LIB} ${TCP_LIB}

)
target_compile_definitions(${PROJECT_NAME} PRIVATE BASE_LIB)
if(SQL_ENABLED)
	target_compile_definitions(${PROJECT_NAME} PRIVATE SQL_ENABLE)
endif()
